package Service;

import Entity.Users;
import com.example.SSMDemo.Mapper.NewsMapper;
import com.example.SSMDemo.Mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class UsersService {
    @Autowired
    UserMapper userMapper;

    public void AddUsers(){}
    public void DeleteUsers(){}
    public void UpdateUsers(){}
    public boolean QueryUsers(Users user) throws SQLException {
        //验证用户名存在性
//        PreparedStatement pstmt;
//        String sql = "select * from  users where username='"+user.getName()+"' and password='"+user.getPassword()+"'";
////        ResultSet rs= SqlHelper.executeQuery(sql);
////        if (rs.next()) {
////            return true;
////        }
        return userMapper.select(user)!=null;
    }
    public void GetUsers(){}
}
